package cn.xiaoliu.hrm.service.impl;

import cn.xiaoliu.hrm.domain.Employee;
import cn.xiaoliu.hrm.mapper.EmployeeMapper;
import cn.xiaoliu.hrm.service.IEmployeeService;
import cn.xiaoliu.hrm.util.AjaxResult;
import cn.xiaoliu.hrm.vo.UserInfoVo;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author xiaoliu
 * @since 2021-12-15
 */
@Service
public class EmployeeServiceImpl extends ServiceImpl<EmployeeMapper, Employee> implements IEmployeeService {
    @Autowired
    private EmployeeMapper employeeMapper;

    /**
     * 登录的时候查询用户信息
     * @param id
     * @return
     */
    @Override
    public AjaxResult findUserInfo(Long id) {
        UserInfoVo userInfo = employeeMapper.findUserInfo(id);
        return AjaxResult.me().setResultObj(userInfo);
    }
}
